package com.wzy.netty.core.dubborpc.customer;

import com.wzy.netty.core.dubborpc.netty.NettyClient;
import com.wzy.netty.core.dubborpc.publicinterface.HelloService;

import java.util.concurrent.TimeUnit;

/**
 * 描述  :
 * 创建人:    Wzy
 * 创建时间: 2020-06-12  23:11
 */
public class ClientBootStrap {
    //定义协议头
    public static final String providerName = "HelloService#hello#";

    public static void main(String[] args) throws InterruptedException {
        NettyClient customer = new NettyClient();
        HelloService bean = (HelloService) customer.getBean(HelloService.class, providerName);
        for (; ; ) {
            TimeUnit.SECONDS.sleep(5);
            String res = bean.hello("你好dubbo!");
            System.out.println("调用返回结果: " + res);
        }
    }
}
